module.exports = app => {
    const mongoose = require('mongoose')
    mongoose.connect('mongodb://localhost:27017/node-vue-moba', {
        useUnifiedTopology:true,
        useNewUrlParser:true
    },function(err){
        if(err){
            console.log('Connection error: ' + err);
        }
        else{
            console.log('Connection success');
        }
    })

    // 将models里面的js文件全部引用
    require('require-all')(__dirname + '/../models')
}